import { getMapToArray, getKeyToValueMap } from "@/utils/utils";

// 订单状态 1.待支付；2.待发货；3.配货中 ；4.待出库；5.配送中；6.订单完成；7.订单取消 8.订单退货
const STATUS_STATUS = Object.freeze({
  ONE: {
    value: "DRAFT",
    label: "已创建",
  },
  WAIT: {
    value: "TO_BE_PAID",
    label: "待付款",
  },
  TWO: {
    value: "TO_BE_SHIPPED",
    label: "客服确认",
  },
  THREE: {
    value: "IN_DISTRIBUTION",
    label: "配货中",
  },
  FOUR: {
    value: "TO_BE_SHIPPED_OUT",
    label: "待出库",
  },
  FIVE: {
    value: "IN_DELIVERY",
    label: "配送中",
  },
  SIX: {
    value: "ORDER_SIGN",
    label: "已签收",
  },
  EL: {
    value: "ORDER_COMPLETED",
    label: "订单已完成",
  },
  TEN: {
    value: "ORDER_RETURNING",
    label: "退款中",
  },
  seven: {
    value: "ORDER_CANCELLATION",
    label: "已取消",
  },
  eight: {
    value: "ORDER_RETURN",
    label: "订单退货",
  },
  // seven: {
  //   value: "ORDER_CANCELLATION",
  //   label: "订单取消",
  // },
  // eight: {
  //   value: "ORDER_RETURN",
  //   label: "订单退货",
  // },
});

export const STATUS_STATUS_ARRAY = getMapToArray(STATUS_STATUS);
export const STATUS_STATUS_MAP = getKeyToValueMap(
  STATUS_STATUS,
  "value",
  "label"
);

// 收货方式：1：物流配送/快递2：仓库配送，3：自提 4 供应商代发
const RECEIVING_GOODS = Object.freeze({
  ONE: {
    value: 1,
    label: "物流配送/快递",
  },
  TWO: {
    value: 2,
    label: "仓库配送",
  },
  THREE: {
    value: 3,
    label: "自提",
  },
  FOUR: {
    value: 4,
    label: "供应商代发",
  },
});
export const RECEIVING_GOODS_ARRAY = getMapToArray(RECEIVING_GOODS);
export const RECEIVING_GOODS_MAP = getKeyToValueMap(
  RECEIVING_GOODS,
  "value",
  "label"
);

// 余额使用状态：0未扣除，1已扣除，2已退还
const BALANCE_STATUS = Object.freeze({
  ONE: {
    value: 0,
    label: "余额使用状态",
  },
  TWO: {
    value: 1,
    label: "已扣除",
  },
  THREE: {
    value: 3,
    label: "已退还",
  },
});

export const BALANCE_STATUS_ARRAY = getMapToArray(BALANCE_STATUS);
export const BALANCE_STATUS_MAP = getKeyToValueMap(
  BALANCE_STATUS,
  "value",
  "label"
);

// 支付状态
const PAY_STATUS = Object.freeze({
  ONE: {
    value: 1,
    label: "未支付",
  },
  TWO: {
    value: 2,
    label: "已发货",
  },
});

export const PAY_STATUS_ARRAY = getMapToArray(PAY_STATUS);
export const PAY_STATUS_MAP = getKeyToValueMap(PAY_STATUS, "value", "label");

// 地址类型
export const ADDRESS_TYPE = Object.freeze({
  ONE: {
    value: 1,
    label: "通用",
  },
  TWO: {
    value: 2,
    label: "发货点",
  },
  THREE: {
    value: 3,
    label: "自提点",
  },
});

export const ADDRESS_TYPE_ARRAY = getMapToArray(ADDRESS_TYPE);
export const ADDRESS_TYPE_MAP = getKeyToValueMap(
  ADDRESS_TYPE,
  "value",
  "label"
);

// 新建拍照下单
export const FLOOR_TYPE = Object.freeze({
  ONE: {
    value: 0,
    label: "电梯",
  },
  TWO: {
    value: 1,
    label: "搬楼",
  },
});

export const FLOOR_TYPE_ARRAY = getMapToArray(FLOOR_TYPE);
export const FLOOR_TYPE_MAP = getKeyToValueMap(FLOOR_TYPE, "value", "label");

//发票类型
export const riseType = Object.freeze({
  ONE: {
    value: 0,
    label: "单位",
  },
  TWO: {
    value: 1,
    label: "个人",
  },
});

export const riseType_ARRAY = getMapToArray(riseType);
export const riseType_MAP = getKeyToValueMap(riseType, "value", "label");
